﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Planisoft.Entities;

namespace Planisoft.DAO
{
    public class UbigeoProvinciaDAO : MasterDataAcces, IUbigeoProvinciaDAO
    {
        public List<UbigeoProvincia> GetAllFromProvincia()
        {
            var query= from c in Context.UbigeoProvincias
                           orderby c.DescUbiProv ascending                           
                           select c;
            return query.ToList();

        }


        public List<UbigeoProvincia> GetFromProvinciaByDepId(int depId)
        {
            var query = from p in Context.UbigeoProvincias
                        where p.idUbiDpto.Equals(depId)
                        select p;

            return query.ToList();  
        }
    }
}
